package heima_bixiangdong.itcast;

public class ThreadDemo {
    public static void main(String[] args) {
        new Thread(){
            @Override
            public void run(){
                for(int i=0; i< 10 ;i++){
                    System.out.println(Thread.currentThread().getName()+"....I..."+i);
                }
            }
        }.start();

        System.out.println("-----------------------");
        Runnable r = new Runnable() {
            @Override
            public void run() {
                for (int j = 0; j < 10; j++) {
                    System.out.println(Thread.currentThread().getName() + "....J..." + j);
                }
            }
        };
        new Thread(r).start();

        System.out.println("-------------------------");
        
        new Thread(new Runnable() {
            @Override
            public void run() {
                for(int k=0;k<10;k++){
                    System.out.println(Thread.currentThread().getName() + "....K..." + k);
                }
            }
        }).start();

        System.out.println("-------------------------");
        
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName()+"--->");
            }
        }){
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName()+"-.-.-.-.");
            }
        }.start();
    }
}
